/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: HP
 * Date: 2023 -04 -29
 * Time: 23:40
 */
public class Triangle extends GeoGraph{
    private int bottom;
    private int height;
    private int bian1;
    private int bian2;     //另外两个边长
    public Triangle(){};
    public Triangle(int bottom,int height,int bian1,int bian2) {
        this.bottom = bottom;
        this.height = height;
        this.bian1 = bian1;
        this.bian1 = bian2;
    }


    public double getArea() {
        return bottom * height / 2;
    };
    public double getPerimeter() {
        return bottom + bian1 + bian2;
    };


    public String toString() {
        return ("三角形的面积是：  "+getArea());
    }

}

